INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})

SET(LIB_NAME OCServer)

SET(TARGET_H
	ServerDef.h
	Server.h
	ServerUtil.h
	ServerTimer.h
	DocGenerate.h
	MapManager.h
	MapCacher.h
	AliasManager.h
	CesTCacher.h
	MapCacherWorkQueue.h
	SqliteFileManager.h
	jwt-cpp/base.h
	jwt-cpp/jwt.h
    ormImp/FileInfo.h
    ormImp/FileData.h
	sqlpp11/sqlpp11orm.h
)

SET(TARGET_SRC
	src/Server.cpp
	src/ServerUtil.cpp
	src/ServerTimer.cpp
	src/DocGenerate.cpp
	src/MapManager.cpp
	src/MapCacher.cpp
	src/AliasManager.cpp
	src/CesTCacher.cpp
	src/MapCacherWorkQueue.cpp
	src/SqliteFileManager.cpp
    sqlpp11/connection.cpp
	sqlpp11/bind_result.cpp
	sqlpp11/prepared_statement.cpp
	sqlpp11/detail/connection_handle.cpp
    ormImp/FileInfo.cc
    ormImp/FileData.cc
)

SETUP_GROUP()

SET(TARGET_LIBRARIES
    OCMain
    drogon
    trantor
)

IF(WIN32)
	SET(TARGET_EXTERNAL_LIBRARIES 
		libcrypto
		libssl
		ws2_32
		odbc32
		sqlite3
		yaml-cpp
	)
ELSE(WIN32)
	SET(TARGET_EXTERNAL_LIBRARIES 
		crypto
		ssl
		odbc
		sqlite3
		yaml-cpp
	)
ENDIF(WIN32)


SETUP_LIBRARY(${LIB_NAME})

ADD_DEPENDENCIES(${LIB_NAME} OCMain)
